#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/videodev2.h>
#include <string.h>
#include <sys/mman.h>
#include <assert.h>
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>

using namespace std;
using namespace cv;

/**
 * 均值滤波是指任意一点的像素值，都是周围 N \times M 个像素值的均值
 */
int main() {
	Mat img = imread("in.jpg", IMREAD_UNCHANGED);
	Mat gray;
	if (img.empty()) {
		printf("No image data \n");
		return -1;
	}
	blur(img, gray, Size(20, 20));
	imwrite("out.jpg", gray);
	return 0;
}
